﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace MSSClient.Model
{
    [Serializable]
    class InvoiceListViewModel : INotifyPropertyChanged
    {
        String indexItem;//识别项目
        String contentItem;//识别内容
        public event PropertyChangedEventHandler PropertyChanged;
        public String IndexItem
        {
            get
            {
                return this.indexItem;
            }
            set
            {
                this.indexItem = value;
                //this.PropertyChanged(this, new PropertyChangedEventArgs("IndexItem"));
            }
        }
        public String ContentItem
        {
            get
            {
                return this.contentItem;
            }
            set
            {
                this.contentItem = value;
                //this.PropertyChanged(this, new PropertyChangedEventArgs("ContentItem"));
            }
        }
        public InvoiceListViewModel(String IndexItem, String ContentItem)
        {
            if (IndexItem.Equals("invoiceType"))
            {
                this.IndexItem = "发票类型";
                //0104普通发票 0101专用发票
                if (ContentItem.Equals("0101"))
                    this.ContentItem = "专用发票";
                else if (ContentItem.Equals("0104"))
                    this.ContentItem = "普通发票";
                else if (ContentItem.Equals("0110"))
                    this.ContentItem = "电子发票";
                else this.ContentItem = "";
                return;
            }
            else if (IndexItem.Equals("invoiceCode"))
            {
                this.IndexItem = "发票代码";
            }
            else if (IndexItem.Equals("invoiceNum"))
            {
                this.IndexItem = "发票号码";
            }
            else if (IndexItem.Equals("invoiceDate"))
            {
                this.IndexItem = "开票日期";
            }
            else if (IndexItem.Equals("amount"))
            {
                this.IndexItem = "不含税金额";
            }
            else if (IndexItem.Equals("totalAmount"))
            {
                this.IndexItem = "含税金额";
            }
            else if (IndexItem.Equals("checkCode"))
            {
                this.IndexItem = "校验码";
            }
            else if (IndexItem.Equals("sellerName"))
            {
                this.IndexItem = "付款方";
            }
            else if (IndexItem.Equals("buyerName"))
            {
                this.IndexItem = "收款方";
            }
            this.ContentItem = ContentItem;
        }
    }
}
